<div class="panel panel-default">
    <div class="panel-heading">
        <span style="font-weight: bold">Edge配置信息</span>
        &nbsp;&nbsp;&nbsp;
        {#                        <a href="/flow/create_config/{{ node.nid }}/">#}
        <a style="float:right;" href="/flow/">
            <i class="glyphicon glyphicon-th" title="首页"></i>
        </a>
    </div>
    <div class="panel-body">
        <div class="modal fade" id="EdgeModal{{ node.nid }}" tabindex="-1" role="dialog"
             aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <form action="/flow/create_node_config/{{ node.nid }}"
                          method="POST">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"
                                    aria-hidden="true">
                                &times;
                            </button>
                            <h4 class="modal-title">
{#                                {% if node.instance_name == 'UserNode' %}添加用户{% else %}#}
{#                                    添加角色{% endif %}#}
                                </h4>
                        </div>
                        <div class="modal-body">
                            {% if node.instance_name == 'UserNode' %}
                                <select name='uid' class="form-control">
                                    {% for item in users %}
                                        <option value="{{ item.uid }}">{{ item.account }}({{ item.name }})</option>
                                    {% endfor %}
                                </select>
                            {% else %}
                                <select name='rid' class="form-control">
                                    {% for item in roles %}
                                        <option value="{{ item.rid }}">{{ item.name }}</option>
                                    {% endfor %}
                                </select>

                            {% endif %}

                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default"
                                    data-dismiss="modal">
                                关闭
                            </button>
                            <button type="submit" class="btn btn-primary">提交</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>

        {% if node.out_edges %}
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>父节点</th>
                    <th>子节点</th>
                    <th>启用状态</th>
                    <th>创建人</th>
                    <th>创建日期</th>
{#                    <th></th>#}
                </tr>
                </thead>
                <tbody>
                {% for edge in node.out_edges %}
                    <tr>
                        <td>{{ edge.id }}</td>
                        <td>{{ edge.parent.name }}({{ edge.parent_id }})</td>
                        <td>{{ edge.child.name }}({{ edge.child_id }})</td>
                        <td>
                            <span class="glyphicon glyphicon-ok-circle"#}
                                                              style="color: blue;font-size: 20px"></span>
{#                            {% if edge.enabled %}#}
{#                                <a href="/flow/update_node_config_enabled/{{ edge.id }}">#}
{#                                                        <span class="glyphicon glyphicon-ok-circle"#}
{#                                                              style="color: blue;font-size: 20px"></span> </a>#}
{#                            {% else %}#}
{#                                <a href="/flow/update_node_config_enabled/{{ edge.id }}">#}
{#                                                        <span class="glyphicon glyphicon-ban-circle"#}
{#                                                              style="color: red;font-size: 20px"></span> </a>#}
{#                            {% endif %}#}
                        </td>
                        <td>{% if edge.create_uid != None %}
                            {{ edge.create_user.name }} {% else %}
                            - {% endif %} </td>
                        <td>{{ edge.create_date }}</td>
{#                        <td style="text-align: center">#}
{#                            <a href="/flow/delete_node_config/{{ edge.id }}">#}
{#                                <i class="glyphicon glyphicon-remove-circle"#}
{#                                   title="删除"></i>#}
{#                            </a>#}
{#                        </td>#}
                    </tr>
                {% endfor %}
                </tbody>
            </table>

        {% else %}
            <div class="jumbotron">


                <h3>没有配置信息</h3>
                <p>&nbsp;</p>
                {% if node.has_user or node.has_role %}
                    <p><a class="btn btn-primary btn" href="/car_form/None"
                          data-toggle="modal" data-target="#EdgeModal{{ node.nid }}"
                          role="button">添加</a></p>
                {% endif %}

            </div>
        {% endif %}

    </div>
</div>